<?php 
header("content-type:text/html;charset=utf-8");
class Car {
	public $carMode;
	public $carBand;
	public $werght;
	public $speed;
   function Car($m,$b,$w,$s){
   	$this->carMode = $m;
   	$this->carBand = $b;
   	$this->weight = $w;
   	$this->speed = $s;
   }

	function getWeight(){
		return $this->weight;
	}
	function getSpeed(){
		return $this->speed;
	}
}

$car1 = new Car("捷达","大众",1.5,170);
print_r($car1);
echo $car1->getWeight();
echo $car1->getSpeed();
 
$bmw = new Car("宝马","大众",1.5,220);
print_r($bmw);
echo $bmw->getWeight();
echo $bmw->getSpeed();
?>